// 导入express
const epxress = require('express')
// 创建路由对象
const router = epxress.Router()

// 导入验证数据的中间件
const expressJoi = require('@escook/express-joi')
// 导入文章分类的验证模块
const { add_cate_schema, update_cate_schema } = require('../schema/artcate')

const artcate_handler = require('../router_handler/article')

router.get('/cates', artcate_handler.getArtCate)

// 新增文章分类的路由
router.post('/addcates', expressJoi(add_cate_schema), artcate_handler.addArticleCates)

// 更新文章分类的路由
router.post('/updatecate', expressJoi(update_cate_schema), artcate_handler.updateCateById)

module.exports = router
